THINGINO_SOUNDS_SITE_METHOD = local
THINGINO_SOUNDS_SITE = $(BR2_EXTERNAL)/package/thingino-sounds

THINGINO_SOUNDS_LICENSE = CC0
THINGINO_SOUNDS_LICENSE_FILES = LICENSE

THINGINO_SOUNDS_FORMAT=opus

define THINGINO_SOUNDS_INSTALL_TARGET_CMDS
	$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/share/sounds

	$(INSTALL) -m 0644 -t $(TARGET_DIR)/usr/share/sounds \
		$(THINGINO_SOUNDS_PKGDIR)/files/th-chime_1.$(THINGINO_SOUNDS_FORMAT) \
		$(THINGINO_SOUNDS_PKGDIR)/files/th-chime_2.$(THINGINO_SOUNDS_FORMAT) \
		$(THINGINO_SOUNDS_PKGDIR)/files/th-chime_3.$(THINGINO_SOUNDS_FORMAT)

	if [ "$(BR2_PACKAGE_THINGINO_SOUNDS_STARTUP)" = "y" ]; then \
		$(INSTALL) -m 0644 $(THINGINO_SOUNDS_PKGDIR)/files/thingino.$(THINGINO_SOUNDS_FORMAT) \
			$(TARGET_DIR)/usr/share/sounds/thingino.$(THINGINO_SOUNDS_FORMAT); \
	fi

	if [ "$(BR2_THINGINO_DEV_DOORBELL)" = "y" ]; then \
		$(INSTALL) -m 0644 -t $(TARGET_DIR)/usr/share/sounds \
			$(THINGINO_SOUNDS_PKGDIR)/files/th-doorbell_1.$(THINGINO_SOUNDS_FORMAT) \
			$(THINGINO_SOUNDS_PKGDIR)/files/th-doorbell_2.$(THINGINO_SOUNDS_FORMAT) \
			$(THINGINO_SOUNDS_PKGDIR)/files/th-doorbell_3.$(THINGINO_SOUNDS_FORMAT); \
	fi
endef

$(eval $(generic-package))
